package com.xx.login_required.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.xx.login_required.annotation.LoginRequired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author fanjj
 * @date 2017/10/18
 */
@Controller
public class TestController {
    private final static ObjectMapper jsonMapper = new ObjectMapper();

    @LoginRequired
    @RequestMapping(value = "/test")
    public String test(String search, Model model) {
        return "/test";
    }

    @LoginRequired(enable = false)
    @RequestMapping(value = "/test1")
    public String test1(String search, Model model) {
        return "/test";
    }

    @LoginRequired(permission = "2")
    @RequestMapping(value = "/test2")
    public String test2(String search, Model model) {
        return "/test";
    }
}
